'use strict';

/**
 * 通用状态枚举
 * @type {{ENABLE: number, DISABLE: number}}
 */
const CommonStatusEnum = {
  // 禁用
  DISABLE: 0,
  // 启用
  ENABLE: 1,
};
/**
 * 系统用户状态
 */
const CommonSystemUserStatusEnum = {
  // 禁用
  DISABLE: 1,
  // 启用
  ENABLE: 0,
}
/**
 * 小程序用户类型
 */
const CommonUserTypeEnum = {
  SYSTEM_USER: 'ADMIN',
  SHOP_USER: 'SHOP_USER',
  USER: 'USER'
}

/**
 * 通用删除状态枚举
 * @type {{DELETED: number, NOT_DELETED: number}}
 */
const CommonDeletedEnum = {
  // 未删除
  NOT_DELETED: 0,
  // 已删除
  DELETED: 1,
};

/**
 * 订单支付方式枚举
 * @type {{POINTS: number, POINTS_MONEY: number, BALANCE: number, WECHAT: string}}
 */
const OrderPaymentEnum = {
  // 微信支付
  WECHAT: 'weixin',
  // 余额支付
  BALANCE: 2,
  // 积分兑换
  POINTS: 3
};

/**
 * 订单发货方式枚举 express 快递, self_pickup 自提, no_delivery 虚拟
 * @type {{VIRTUAL: string, SELF_PICKUP: string, EXPRESS: string}}
 */
const OrderDeliveryEnum = {
  // 快递发货
  EXPRESS: 'express',
  // 自提
  SELF_PICKUP: 'self_pickup',
  // 虚拟商品
  VIRTUAL: 'no_delivery',
};

/**
 * 订单状态枚举
 * @type {{COMPLETED: number, CANCELLED: number, PENDING_PAYMENT: number, PENDING_DELIVERY: number, PENDING_RECEIPT: number}}
 */
const OrderStatusEnum = {
  // 待定价
  PENDING_PRICING: 'pending_pricing',
  // 待支付
  PENDING_PAYMENT: 'pending',
  // 已支付
  PAID: 'paid',
  // 已退款
  REFUNDED: 'refunded',
  // 退款中
  REFUNDING: 'refunding',
  // 已完成
  COMPLETED: 'completed',
  // 已取消
  CANCELLED: 'cancelled',
  // 已发货
  SHIPPED: 'shipped',
  // 待核销
  PENDING_VERIFICATION: 'pending_verification',
  // 待收货
  PENDING_RECEIPT: 'pending_receipt',
};

/**
 * 退款状态枚举
 * @type {{PENDING: number, SUCCESS: number, FAILED: number}}
 */
const RefundStatusEnum = {
  // 待处理
  PENDING: 0,
  // 退款中
  REFUNDING: 1,
  // 退款成功
  SUCCESS: 2,
  // 退款失败
  FAILED: 3,
};

/**
 * 退款类型枚举
 * @type {{ONLY_MONEY: number, ONLY_POINTS: number, MONEY_POINTS: number}}
 */
const RefundTypeEnum = {
  // 仅退款
  ONLY_MONEY: 1,
  // 仅退积分
  ONLY_POINTS: 2,
  // 退款和积分
  MONEY_POINTS: 3,
};

/**
 * 核销状态枚举
 * @type {{VERIFIED: number, PENDING: number}}
 */
const VerificationStatusEnum = {
  // 待核销
  PENDING: 0,
  // 已核销
  VERIFIED: 1,
};

/**
 * 预约状态枚举
 * @type {{COMPLETED: number, CANCELLED: number, PENDING_CONFIRM: number, CONFIRMED: number, NO_SHOW: number}}
 */
const AppointmentStatusEnum = {
  // 待确认-已预约
  PENDING_CONFIRM: 1,
  // 已确认-待到店
  CONFIRMED: 2,
  // 已完成
  COMPLETED: 3,
  // 已取消
  CANCELLED: 4,
  // 已爽约
  NO_SHOW: 5,
};

/**
 * 预约取消类型
 */
const AppointmentCancelTypeEnum = {
  // 用户取消
  USER_CANCEL: 1,
  // 员工取消
  STAFF_CANCEL: 2,
  // 管理员取消
  ADMIN_CANCEL: 3,
  // 系统取消
  SYSTEM_CANCEL: 4,
};
/**
 * 预约类型
 */
const AppointmentTypeEnum = {
  // 用户预约
  USER_APPOINTMENT: 1,
  // 员工预约（APP）
  STAFF_APPOINTMENT: 2,
  // 管理员预约（后台）
  ADMIN_APPOINTMENT: 3,
};

/**
 * 积分变动类型枚举
 * @type {{SHOPPING_GAIN: number, SIGNIN_GAIN: number, ACTIVITY_GAIN: number, ADMIN_ADJUST: number, SHOPPING_CONSUME: number, EXCHANGE_CONSUME: number, EXPIRE_REDUCE: number}}
 */
const PointsChangeTypeEnum = {
  // 购物获得
  SHOPPING_GAIN: 1,
  // 签到获得
  SIGNIN_GAIN: 2,
  // 活动获得
  ACTIVITY_GAIN: 3,
  // 管理员调整
  ADMIN_ADJUST: 4,
  // 购物消费
  SHOPPING_CONSUME: 5,
  // 兑换消费
  EXCHANGE_CONSUME: 6,
  // 过期消减
  EXPIRE_REDUCE: 7,
};

/**
 * 积分规则类型枚举
 * @type {{SHOPPING: number, SIGNIN: number, ACTIVITY: number}}
 */
const PointsRuleTypeEnum = {
  // 购物规则
  SHOPPING: 1,
  // 签到规则
  SIGNIN: 2,
  // 活动规则
  ACTIVITY: 3,
};

/**
 * 余额变动类型枚举
 * @type {{RECHARGE: number, CONSUME: number, REFUND: number, ADMIN_ADJUST: number}}
 */
const BalanceChangeTypeEnum = {
  // 充值
  RECHARGE: 1,
  // 消费
  CONSUME: 2,
  // 退款
  REFUND: 3,
  // 管理员调整
  ADMIN_ADJUST: 4,
};


module.exports = {
  CommonUserTypeEnum,
  CommonStatusEnum,
  CommonSystemUserStatusEnum,
  CommonDeletedEnum,
  OrderPaymentEnum,
  OrderDeliveryEnum,
  OrderStatusEnum,
  RefundStatusEnum,
  RefundTypeEnum,
  VerificationStatusEnum,
  AppointmentTypeEnum,
  AppointmentStatusEnum,
  AppointmentCancelTypeEnum,
  PointsChangeTypeEnum,
  PointsRuleTypeEnum,
  BalanceChangeTypeEnum,
};
